<%--
  Created by IntelliJ IDEA.
  User: drophair
  Team: 深藏blow
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>管理员仓库</title>
    <script src="/js/jquery-3.4.1.min.js"></script>
    <link rel="stylesheet" href="/css/bootstrap.min.css">
</head>
<body background="/img/bg.png">
<h1>软件仓库-添加库存</h1><hr>
<%
    String error="";
    error=(String) request.getAttribute("error");
    Cookie[] cookies=request.getCookies();
    for(Cookie cookie:cookies){
        if(cookie.getName().equals("uwho")){
            System.out.println(cookie.getValue());
            if(!cookie.getValue().equals("0")){
                request.setAttribute("error","非法访问");
                request.getRequestDispatcher("/error.jsp").forward(request,response);
            }
        }
    }
%>
<form action="/AddGoodServlet" method="post" style="text-align: center">
    <%
        if(error!=null&&!error.equals("")){%>
    <div style="color: red"><%=error%><br></div><%
        }%>
    <h4 style="display: inline-block">商品名称：</h4><input name="goodname"><br>
    <h4 style="display: inline-block">商品价格：</h4><input name="goodprice"><br>
    <input type="submit" value="新增商品" class="btn btn-dark">
</form>
</body>
</html>
